﻿@model IEnumerable<WebPageTemplate>
@UIHelper.ImageTitle(Html.Global("RES_CREATEPAGE"), "Create a new webpage from template.", "~/content/images/add_page_48x48.png")
<ul class="ui-helper-reset">
    <li><a href="@Url.Action("Create", "DynamicUI")">
        <table style="width: 100%;">
            <tr>
                <td style="width: 48px;">
                    <img src="@Url.Content("~/content/images/icon_newpage_48.png")" alt="Blank" />
                </td>
                <td style="vertical-align: top;">
                    <section>
                        <header>@Html.Global("tmpl","BlankPage") </header>
                        <p>@Html.Global("tmpl","BlankPageDesc")
                           </p>
                    </section>
                </td>
            </tr>
        </table>
    </a></li>
    @foreach (var page in Model)
    { 
        <li style="cursor: pointer;">
            @using (Html.BeginForm())
            {
                <input type="hidden" name="tmpl" value="@page.Name" />
                <table style="width: 100%;" onclick="$(this).parent().submit();">
                    <tr>
                        <td style="width: 48px;">
                            @if (!string.IsNullOrEmpty(page.ImageUrl))
                            {
                                var imgUrl = Url.Content(page.ImageUrl.Replace("{website}", WebSiteContext.Current.Web.Name));
                                <img src="@imgUrl" alt="@page.Name" />
                            }
                        </td>
                        <td style="vertical-align: top;">
                            <section>
                                <header>@GE.GetContent(page.Title)
                                </header>
                                <p>
                                    @GE.GetContent(page.Description)</p>
                            </section>
                        </td>
                    </tr>
                </table>
            }
        </li>
    }
</ul>
@UIHelper.SectionHeader(Html.Global("PageWizard_ImportTmplFile"))
@using (Html.BeginForm("ImportFromTmpl", "DynamicUI", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <p>@Html.Global("PageWizard_SelectTmplFile")</p>
    <p>
        <input type="file" />@Ajax.Dna().Button().LocText("RES_UPLOAD").Submit().GetHtml()</p>
}
